
//
//  Exhibition.m
//  Work2
//
//  Created by cora1n on 14-8-18.
//  Copyright (c) 2014年 devwu. All rights reserved.
//

#import "Exhibition.h"

@implementation Exhibition
-(id)initWithName:(NSString *)name
{
    if (self= [super init]) {
        _currentPersons = [NSMutableArray array];
        _historyPersons = [NSMutableArray array];
        _name = name;
    }
    return self;
}
-(BOOL)enterWithPerson:(Person *)p
{
    if (_currentPersons.count<100) {
        [_currentPersons addObject:p];
        return YES;
    }
    else
    {
        return NO;
    }
}

-(BOOL)exitWithPerson:(Person *)p
{
    if ([_currentPersons containsObject:p]) {
        [_currentPersons removeObject:p];
        return YES;
    }
    else
    {
        return NO;
    }
}


@end
